package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheer.entity.ReferenceFileEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 台账文档表
 * 
 * @author chufangzheng
 * @email 1280251739@qq.com
 * @date 2022-02-16 08:58:00
 */
@Mapper
public interface ReferenceFileDao extends BaseMapper<ReferenceFileEntity> {

    default void removeByReferenceId(Long referenceId){

        QueryWrapper<ReferenceFileEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(ReferenceFileEntity::getReferenceId, referenceId);
        delete(queryWrapper);
    }

    default List<ReferenceFileEntity> selectByReferenceId(Long referenceId){

        QueryWrapper<ReferenceFileEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(ReferenceFileEntity::getReferenceId, referenceId);
        List<ReferenceFileEntity> list = selectList(queryWrapper);
        return list;
    }



}
